﻿@model IEnumerable<asMeishi.web.Models.shop>
@using publicLibrary
@using asMeishi.web.Models
@using asMeishi.web
@using asMeishi.web.Classes
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
    
}

<script src="/Content/script/shopSift.js"></script>

<div class="siftKeyword cbcolor" ><input type="text" id="keyword" /><button onclick="shopSearch(true)" class="btn btn-small ebcolor">查询</button></div>
<input type="hidden" name="pageIndex" value="0" />
<input type="hidden" name="pageSize" value="10" />
<div class="siftPanle cbcolor" id="shopSiftPanle" >
    
    <div class="item">
        <div class="label">区</div>
        <div class="field" onclick="t1(event)">
            <span class='subItem'><input type='checkbox' name='area' value="铁西区"/><label >铁西区</label></span>
            <span class='subItem'><input type='checkbox' name='area' value="铁东区"/><label >铁东区</label></span>
            <span class='subItem'><input type='checkbox' name='area' value="立山区"/><label >立山区</label></span>
            <span class='subItem'><input type='checkbox' name='area' value="千山区"/><label >千山区</label></span>
        </div>
    </div>
    <div class="item ">
        <div class="label">街道</div>
        <div class="field" onclick="t1(event)">
            <span class='subItem'><input type='checkbox' name='street'  value="湖南"><label>湖南</label></span>
            <span class='subItem'><input type='checkbox' name='street'  value="山南"><label>山南</label></span>
            <span class='subItem'><input type='checkbox' name='street'  value="永乐"><label>永乐</label></span>
            <span class='subItem'><input type='checkbox' name='street'  value="二台子"><label>二台子</label></span>
            <span class='subItem'><input type='checkbox' name='street'  value="兴盛"><label >兴盛</label></span>
            <span class='subItem'><input type='checkbox' name='street'  value="小东门"><label >小东门</label></span>
        </div>
    </div>
    <div class="item ">
        <div class="label"  >首菜系</div>
        <div class="field" onclick="t1(event)">@(dictClass.get("shopClass").SplitToHTMLbyCode("<span class='subItem'><input name='foodStyleList' type='checkbox' value='_varA_'/><label href='_varA_'>_varB_</label></span>\n"))
        </div>
    </div>
    <div class="item ">
        <div class="label" >人均价格</div>
        <div class="field" onclick="t1(event)">
            <span class='subItem'><input type='checkbox' name='cost' value="1-15"/><label>1-15</label></span>
            <span class='subItem'><input type='checkbox' name='cost' value="16-30"/><label>16-30</label></span>
            <span class='subItem'><input type='checkbox' name='cost' value="31-50"/><label>31-50</label></span>
            <span class='subItem'><input type='checkbox' name='cost' value="51-80"/><label>51-80</label></span>
            <span class='subItem'><input type='checkbox' name='cost' value="80-∞"/><label>80以上</label></span>
        </div>
    </div>
    <div class="item ">
        <div class="label">规模</div>
        <div class="field" onclick="t1(event)">
            @(dictClass.get("shopSize").SplitToHTMLbyCode("<span class='subItem'><input name='size' type='checkbox' value='_varA_'/><label/>_varB_</label></span>\n"))
        </div>
    </div>
    @* 
    <div class="item">
        <div class="label">适合</div>
        <div class="field" onclick="t1(event)">
            @Html.myHtmlDom("environment",dictClass.get("shopEnvironment"),selectType.多选,"")
           @(dictClass.get("shopFit").SplitToHTMLbyCode("<span class='subItem'><input name='shopFit' type='checkbox' value='_varA_'/><label/>_varB_</label></span>"))

        </div>
    </div>
    *@
    <div class="item ">
        <div class="label">环境</div>
        <div class="field" onclick="t1(event)">
        @(dictClass.get("shopEnvironment").SplitToHTMLbyCode("<span class='subItem'><input name='environment' type='checkbox' value='_varA_'/><label/>_varB_</label></span>\n"))
        
        </div>
    </div>
    <div class="siftSumPanle ">
        <div>符合条件的食场有<span id="siftSumVal">@ViewBag.sum</span>条 
        <button class="siftSumViewBtn btn nbcolor" onclick="listViewSubmit(true)">点击查看</button></div>
    </div>
</div>
<div class="actbar" onclick="$('#shopSiftPanle').slideToggle('fast');"></div>
    @if (Model.Any())
    {

<div class="navPage" style=" margin-top:10px; text-align:right">当前：<span id="navPageNowVal">0-10</span> 总:<span id="navPageSumVal">@ViewBag.sum</span> 条</div>
    }
<!--筛选结果-->
    

<div class="shopListPanle clearfix" id="shopListPanle" >

    @if (!Model.Any())
    {
        <div style=" padding:30px 30px; border:1px dashed #8db54c; background:#f9f9f9;  margin:10px 0px; text-align:center">
        请您根据以上条件搜索产品  <br />
        当前存在的总记录数<span style="font-size:26px;" class="ncolor"> @publicDictApp.shopTotalCount </span>
            <div id="expandShopPanel" style="text-align:center"></div>
        </div>
    }

    @Html.Partial("siftResult", Model)


</div>

    <a href="###" onclick="nextViewSubmit()" class="getMoreBtn" id="nextViewSubmitBtn" style="display:none">↓↓取得更多</a>


<!--筛选结果-->
<!--随机推广-->

<script>
    $(getExpandShop);

    function getExpandShop() {

        $.get("/sitePublic/Ajax_getRandomShop/7", function (json) {

            var expandShop = $("#expandShopPanel");
            for (var i = 0; i < json.length; i++) {

                writeExpandShopJSON(expandShop, json[i]);
            }
        })
    }
    function writeExpandShopJSON(target, j) {

        if (j.pic == null) {
            j.pic = baseConfig.siteThemePath + "images/shopNullPic.png";
        } else {
            j.pic = "/upload/shopPic/s/" + j.pic + ".jpg";
        }
        if (j.sum_score=="0.0") {
            j.sum_score = "<span style='color:gray; font-weight:100;font-size:12px; '>暂无评价</span>";
        }
        if (j.foodStyle == null || j.foodStyle=="") {
            j.foodStyle = "[ 暂无 ]";
        }
        var htmlstr = "<div class='item' ><a href='/shop/detail/" + j.Id + "'> <img src='" + j.pic + "'/><span class='name nowrap' href='#'>" + j.name + "</span></a><span class='foodStyle nowrap'>" + j.foodStyle + "</span> <span class='score ncolor'>" + j.sum_score + "</span> </div>"

        target.append(htmlstr);
    }
</script>
<!--随机推广-->
<div class="clearFloat"></div>
